<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<title>CURLOPT_SSL_VERIFYHOST man page</title>
<meta name="generator" content="roffit">
<STYLE type="text/css">
pre {
  overflow: auto;
  margin: 0;
}

P.level0, pre.level0 {
 padding-left: 2em;
}

P.level1, pre.level1 {
 padding-left: 4em;
}

P.level2, pre.level2 {
 padding-left: 6em;
}

span.emphasis {
 font-style: italic;
}

span.bold {
 font-weight: bold;
}

span.manpage {
 font-weight: bold;
}

h2.nroffsh {
 background-color: #e0e0e0;
}

span.nroffip {
 font-weight: bold;
 font-size: 120%;
 font-family: monospace;
}

p.roffit {
 text-align: center;
 font-size: 80%;
}
</STYLE>
</head><body>

<p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2>
<p class="level0">CURLOPT_SSL_VERIFYHOST - verify the certificate's name against host <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2>
<p class="level0">&#35;include &lt;curl/curl.h&gt; 
<p class="level0">CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_VERIFYHOST, long verify); <a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
<p class="level0">Pass a long as parameter specifying what to <span Class="emphasis">verify</span>. 
<p class="level0">This option determines whether libcurl verifies that the server cert is for the server it is known as. 
<p class="level0">When negotiating TLS and SSL connections, the server sends a certificate indicating its identity. 
<p class="level0">When <a Class="emphasis" href="./CURLOPT_SSL_VERIFYHOST.html">CURLOPT_SSL_VERIFYHOST</a> is 2, that certificate must indicate that the server is the server to which you meant to connect, or the connection fails. Simply put, it means it has to have the same name in the certificate as is in the URL you operate against. 
<p class="level0">Curl considers the server the intended one when the Common Name field or a Subject Alternate Name field in the certificate matches the host name in the URL to which you told Curl to connect. 
<p class="level0">When the <span Class="emphasis">verify</span> value is 1, <span Class="emphasis">curl_easy_setopt</span> will return an error and the option value will not be changed.  It was previously (in 7.28.0 and earlier) a debug option of some sorts, but it is no longer supported due to frequently leading to programmer mistakes. Future versions will stop returning an error for 1 and just treat 1 and 2 the same. 
<p class="level0">When the <span Class="emphasis">verify</span> value is 0, the connection succeeds regardless of the names in the certificate. Use that ability with caution! 
<p class="level0">The default value for this option is 2. 
<p class="level0">This option controls checking the server's certificate's claimed identity. The server could be lying.  To control lying, see <a Class="emphasis" href="./CURLOPT_SSL_VERIFYPEER.html">CURLOPT_SSL_VERIFYPEER</a>.  If libcurl is built against NSS and <a Class="emphasis" href="./CURLOPT_SSL_VERIFYPEER.html">CURLOPT_SSL_VERIFYPEER</a> is zero, <a Class="emphasis" href="./CURLOPT_SSL_VERIFYHOST.html">CURLOPT_SSL_VERIFYHOST</a> is also set to zero and cannot be overridden. <a name="DEFAULT"></a><h2 class="nroffsh">DEFAULT</h2>
<p class="level0">2 <a name="PROTOCOLS"></a><h2 class="nroffsh">PROTOCOLS</h2>
<p class="level0">All TLS based protocols: HTTPS, FTPS, IMAPS, POP3, SMTPS etc. <a name="EXAMPLE"></a><h2 class="nroffsh">EXAMPLE</h2>
<p class="level0"><pre class="level0">
CURL *curl = curl_easy_init();
if(curl) {
&nbsp; curl_easy_setopt(curl, CURLOPT_URL, "<a href="https://example.com">https://example.com</a>");
&nbsp;
&nbsp; /* Set the default value: strict name check please */
&nbsp; curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 2L);
&nbsp;
&nbsp; curl_easy_perform(curl);
}
</pre>

<p class="level0"><a name="AVAILABILITY"></a><h2 class="nroffsh">AVAILABILITY</h2>
<p class="level0">If built TLS enabled. <a name="RETURN"></a><h2 class="nroffsh">RETURN VALUE</h2>
<p class="level0">Returns CURLE_OK if TLS is supported, and CURLE_UNKNOWN_OPTION if not. 
<p class="level0">If 1 is set as argument, <span Class="emphasis">CURLE_BAD_FUNCTION_ARGUMENT</span> is returned. <a name="SEE"></a><h2 class="nroffsh">SEE ALSO</h2>
<p class="level0"><a Class="manpage" href="./CURLOPT_SSL_VERIFYPEER.html">CURLOPT_SSL_VERIFYPEER</a>, <a Class="manpage" href="./CURLOPT_CAINFO.html">CURLOPT_CAINFO</a><p class="roffit">
 This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>.
</body></html>
